<div class="row">
  <div class="col-md-4">
    <div class="panel panel-success">
      <div class="panel-heading">
        <h3 class="panel-title">
          <a ui-sref="opportunityIndex()" class="btn btn-success">
            <i class="fa fa-building"></i> Opportunities
          </a>
        </h3>
      </div>
      <div class="panel-body">
        <div ng-if="opportunities.length == 0" class="alert alert-info" role="alert">
          You currently do not have any opportunties associated with your account. Click <strong>New Opportunity</strong> to add one.
        </div>
        <table ng-if="opportunities.length > 0" class="table table-striped">
          <thead>
            <tr>
              <th>For</th>
              <th>Type</th>
              <th>Submitted</th>
            </tr>
          </thead>
          <tbody>
            <tr data-ng-repeat="opportunity in opportunities">
              <td><a ui-sref="opportunity.view({opportunityId: opportunity._id})">{{ opportunity.data.customer.data.name }}</a></td>
              <td><a ui-sref="opportunity.view({opportunityId: opportunity._id})">{{ opportunity.data.quoteType }}</a></td>
              <td>{{ opportunity.created | amDateFormat:'MMMM Do YYYY' }}</td>
            </tr>
          </tbody>
        </table>
        <bgf-pagination collection="opportunities" url="opportunitiesUrl" per-page="5" template-url="./views/pager.html"></bgf-pagination>
      </div>
      <div class="panel-footer">
        <a ui-sref="opportunityCreate()" class="btn btn-primary">
          <i class="glyphicon glyphicon-plus"></i> New Opportunity
        </a>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="panel panel-success">
      <div class="panel-heading">
        <h3 class="panel-title">
          <a ui-sref="customerIndex()" class="btn btn-success">
            <i class="fa fa-users"></i> Customers
          </a>
        </h3>
      </div>
      <div class="panel-body">
        <div ng-if="customers.length == 0" class="alert alert-info" role="alert">
          You currently no customers associated with this application. Click <strong>New Customer</strong> to add one.
        </div>
        <table ng-if="customers.length > 0" class="table table-striped">
          <thead>
            <tr>
              <th>Name</th>
              <th>Submitted</th>
              <th>Operations</th>
            </tr>
          </thead>
          <tbody>
            <tr data-ng-repeat="customer in customers">
              <td><a ui-sref="customer.view({customerId: customer._id})">{{ customer.data.name }}</a></td>
              <td>{{ customer.created | amDateFormat:'MMMM Do YYYY' }}</td>
              <td>
                <div class="button-group">
                  <a ui-sref="customer.edit({customerId: customer._id})" class="btn btn-default btn-sm">
                    <span class="glyphicon glyphicon-edit"></span>
                  </a>
                  <a ui-sref="customer.delete({customerId: customer._id})" class="btn btn-danger btn-sm">
                    <span class="glyphicon glyphicon-remove-circle"></span>
                  </a>
                </div>
              </td>
            </tr>
          </tbody>
        </table>
        <bgf-pagination collection="customers" url="customersUrl" per-page="5" template-url="./views/pager.html"></bgf-pagination>
      </div>
      <div class="panel-footer">
        <a ui-sref="customerCreate()" class="btn btn-primary">
          <i class="fa fa-user-plus"></i> New Customer
        </a>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="panel panel-success">
      <div class="panel-heading">
        <h3 class="panel-title">
          <a ui-sref="contractIndex()" class="btn btn-success">
            <i class="fa fa-dollar"></i> Contracts
          </a>
        </h3>
      </div>
      <div class="panel-body">
        <div ng-if="contracts.length == 0" class="alert alert-info" role="alert">
          You currently do not have any contracts associated with your account. Click <strong>New Contract</strong> to add one.
        </div>
        <table ng-if="contracts.length > 0" class="table table-striped">
          <thead>
            <tr>
              <th>Company</th>
              <th>Opportunity</th>
              <th>Submitted</th>
            </tr>
          </thead>
          <tbody>
            <tr data-ng-repeat="contract in contracts">
              <td><a ui-sref="contract.view({contractId: contract._id})">{{ contract.data.customer.data.name }}</a></td>
              <td><a ui-sref="contract.view({contractId: contract._id})">{{ contract.data.opportunity.data.opportunityNumber }}</a></td>
              <td>{{ contract.created | amDateFormat:'MMMM Do YYYY' }}</td>
            </tr>
          </tbody>
        </table>
        <bgf-pagination collection="contracts" url="contractsUrl" per-page="5" template-url="./views/pager.html"></bgf-pagination>
      </div>
      <div class="panel-footer">
        <a ui-sref="contractCreate()" class="btn btn-primary">
          <i class="glyphicon glyphicon-plus"></i> New Contract
        </a>
      </div>
    </div>
  </div>
</div>
<div class="row">
  <div class="col-md-4">
    <div class="panel panel-success" ng-if="isAdmin">
      <div class="panel-heading">
        <h3 class="panel-title">
          <a ui-sref="quoteIndex()" class="btn btn-success">
            <i class="fa fa-building"></i> Quotes
          </a>
        </h3>
      </div>
      <div class="panel-body">
        <div ng-if="quotes.length == 0" class="alert alert-info" role="alert">
          You currently do not have any quotes. Click <strong>New Quote</strong> to add one.
        </div>
        <table ng-if="quotes.length > 0" class="table table-striped">
          <thead>
            <tr>
              <th>For</th>
              <th>Submitted</th>
            </tr>
          </thead>
          <tbody>
            <tr data-ng-repeat="quote in quotes">
              <td><a ui-sref="quote.view({quoteId: quote._id})">{{ quote.data.customer.data.name }}</a></td>
              <td>{{ quote.created | amDateFormat:'MMMM Do YYYY' }}</td>
            </tr>
          </tbody>
        </table>
        <bgf-pagination collection="quotes" url="quotesUrl" per-page="5" template-url="./views/pager.html"></bgf-pagination>
      </div>
      <div class="panel-footer">
        <a ui-sref="quoteCreate()" class="btn btn-primary">
          <i class="glyphicon glyphicon-plus"></i> New Quote
        </a>
      </div>
    </div>
  </div>
  <div class="col-md-4">
    <div class="panel panel-success" ng-if="isAdmin">
      <div class="panel-heading">
        <h3 class="panel-title">
          <a ui-sref="agentIndex()" class="btn btn-success">
            <i class="fa fa-building"></i> Agents
          </a>
        </h3>
      </div>
      <div class="panel-body">
        <div ng-if="agents.length == 0" class="alert alert-info" role="alert">
          You currently do not have any agents. Click <strong>New Quote</strong> to add one.
        </div>
        <table ng-if="agents.length > 0" class="table table-striped">
          <thead>
            <tr>
              <th>For</th>
              <th>Submitted</th>
            </tr>
          </thead>
          <tbody>
            <tr data-ng-repeat="agent in agents">
              <td><a ui-sref="agent.view({agentId: agent._id})">{{ agent.data.firstName }} {{ agent.data.lastName }}</a></td>
              <td>{{ agent.created | amDateFormat:'MMMM Do YYYY' }}</td>
            </tr>
          </tbody>
        </table>
        <bgf-pagination collection="agents" url="agentsUrl" per-page="5" template-url="./views/pager.html"></bgf-pagination>
      </div>
      <div class="panel-footer">
        <a ui-sref="agentCreate()" class="btn btn-primary">
          <i class="glyphicon glyphicon-plus"></i> New Agent
        </a>
      </div>
    </div>
  </div>
</div>
